<template>
   <div class="content">
        <div style="width:100%;height:50px;text-align:center;line-height:50px;font-size: 18px;border-bottom:1px solid black"
        @click="onClick">全民砍价--></div>
        <div v-for="(item,index) in list.reverse().slice(17,19)" :key="index" class="content_wrapper"
        @click="onClick">
          <div class="content_wrapper_img">
            <img :src="item.pic" alt="" class="content_img">
          </div>
          <div class="content_wrapper_tent">
            <div style="font-size:16px;height:50px;display:flex;justify-content:flex-start;align-items: center;">{{item.name}}</div>
            <div class="characteristic">{{item.characteristic}}</div>
            <div class="content_wrapper_tent_wrapper">
              <div>
                <div>{{item.minPrice | Price}}</div>
                <div>低价</div>
              </div>
              <div>
                <div>{{item.originalPrice | Price}}</div>
                <div>原价</div>
              </div>
              <div>
                <div>{{item.stores | stores}}</div>
                <div>限量</div>
              </div>
            </div>
          </div>
        </div>
      </div>
</template>

<script>
import axios from "axios";
export default {
    data(){
        return{
            list:[]
        }
    },
     mounted(){
    axios.get("https://api.it120.cc/small4/shop/goods/list").then(res=>{
      // console.log(res);
      this.list = res.data.data
      // console.log(this.list);
    }).catch(error=>{
      console.log(error);
      return
    })
  },
    methods:{
    onClick(){
      localStorage.setItem("list",JSON.stringify(this.list))
      this.$router.push({
        path:this.$myRouter.PathConfig.LISTOF,
        query:{
          list:this.list
        }
      })
    }
  },
    filters:{
    Price:function(val){
      return '￥' + val
    },
    stores:function(val){
      return val + "件"
    }
  },
}
</script>

<style>

</style>